
using System;
using System.Collections.Generic;
using System.Text;
using NFinal.Extension;

namespace BlackHtml5.WebSite.Models.Entity.Common
{
    public struct fields:NFinal.IModel
    {
		public System.Int32? a1;
		public System.Int64? a2;
		public System.Byte? a3;
		public System.Int16? a4;
		public System.Object a5;
		public System.Int64? a6;
		public System.Object a7;
		public System.Object a8;
		public System.SByte? a9;
		public System.Object a10;
		public System.String a11;
		public System.Object a12;
		public System.String a13;
		public System.Object a14;
		public System.String a15;
		public System.String a16;
		public System.String a17;
		public System.Byte[] a18;
		public System.Double? a19;
		public System.Double? a20;
		public System.Object a21;
		public System.Double? a22;
		public System.Decimal? a23;
		public System.Decimal? a24;
		public System.Boolean? a25;
		public System.DateTime? a26;
		public System.DateTime? a27;
		#region Nullable
		private bool __is_null__;
        public bool __Is_Null__
        {
            get {
                return __is_null__;
            }
            set
            {
                 __is_null__=value;
            }
        }
        public static implicit operator fields(string __value__)
        {
            var __value2__ = new fields();
            __value2__.__Is_Null__ = __value__==null;
            return __value2__;
        }
        public static  bool operator true(fields __value__)
        {
            return !__value__.__is_null__;
        }
        public static bool operator false(fields __value__)
        {
            return !__value__.__is_null__;
        }
		#endregion
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out fields par)
		{
			par=new fields();
			try
			{
						par.a1=null;
						if(get["a1"]!=null)
						{
							par.a1=get["a1"].AsVar();
						}
						par.a2=null;
						if(get["a2"]!=null)
						{
							par.a2=get["a2"].AsVar();
						}
						par.a3=null;
						if(get["a3"]!=null)
						{
							par.a3=get["a3"].AsVar();
						}
						par.a4=null;
						if(get["a4"]!=null)
						{
							par.a4=get["a4"].AsVar();
						}
						par.a5=get["a5"];
						par.a6=null;
						if(get["a6"]!=null)
						{
							par.a6=get["a6"].AsVar();
						}
						par.a7=get["a7"];
						par.a8=get["a8"];
						par.a9=null;
						if(get["a9"]!=null)
						{
							par.a9=get["a9"].AsVar();
						}
						par.a10=get["a10"];
						par.a11=get["a11"];
						par.a12=get["a12"];
						par.a13=get["a13"];
						par.a14=get["a14"];
						par.a15=get["a15"];
						par.a16=get["a16"];
						par.a17=get["a17"];
						par.a19=null;
						if(get["a19"]!=null)
						{
							par.a19=get["a19"].AsVar();
						}
						par.a20=null;
						if(get["a20"]!=null)
						{
							par.a20=get["a20"].AsVar();
						}
						par.a21=get["a21"];
						par.a22=null;
						if(get["a22"]!=null)
						{
							par.a22=get["a22"].AsVar();
						}
						par.a23=null;
						if(get["a23"]!=null)
						{
							par.a23=get["a23"].AsVar();
						}
						par.a24=null;
						if(get["a24"]!=null)
						{
							par.a24=get["a24"].AsVar();
						}
						par.a25=null;
						if(get["a25"]!=null)
						{
							par.a25=get["a25"].AsVar();
						}
						par.a26=null;
						if(get["a26"]!=null)
						{
							par.a26=get["a26"].AsVar();
						}
						par.a27=null;
						if(get["a27"]!=null)
						{
							par.a27=get["a27"].AsVar();
						}
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"a1\":");
					tw.Write(a1==null?"null" : a1.ToString());
					tw.Write(",");
					tw.Write("\"a2\":");
					tw.Write(a2==null?"null" : a2.ToString());
					tw.Write(",");
					tw.Write("\"a3\":");
					tw.Write(a3==null?"null" : a3.ToString());
					tw.Write(",");
					tw.Write("\"a4\":");
					tw.Write(a4==null?"null" : a4.ToString());
					tw.Write(",");
					tw.Write("\"a5\":");
					tw.Write("\"");
					tw.Write(a5==null?"null":a5.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a6\":");
					tw.Write(a6==null?"null" : a6.ToString());
					tw.Write(",");
					tw.Write("\"a7\":");
					tw.Write("\"");
					tw.Write(a7==null?"null":a7.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a8\":");
					tw.Write("\"");
					tw.Write(a8==null?"null":a8.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a9\":");
					tw.Write(a9==null?"null" : a9.ToString());
					tw.Write(",");
					tw.Write("\"a10\":");
					tw.Write("\"");
					tw.Write(a10==null?"null":a10.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a11\":");
					tw.Write("\"");
					tw.Write(a11==null?"null":a11);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a12\":");
					tw.Write("\"");
					tw.Write(a12==null?"null":a12.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a13\":");
					tw.Write("\"");
					tw.Write(a13==null?"null":a13);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a14\":");
					tw.Write("\"");
					tw.Write(a14==null?"null":a14.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a15\":");
					tw.Write("\"");
					tw.Write(a15==null?"null":a15);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a16\":");
					tw.Write("\"");
					tw.Write(a16==null?"null":a16);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a17\":");
					tw.Write("\"");
					tw.Write(a17==null?"null":a17);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a18\":");
					tw.Write("\"");
					tw.Write(a18==null?"null":Convert.ToBase64String(a18));
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a19\":");
					tw.Write(a19==null?"null" : a19.ToString());
					tw.Write(",");
					tw.Write("\"a20\":");
					tw.Write(a20==null?"null" : a20.ToString());
					tw.Write(",");
					tw.Write("\"a21\":");
					tw.Write("\"");
					tw.Write(a21==null?"null":a21.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a22\":");
					tw.Write(a22==null?"null" : a22.ToString());
					tw.Write(",");
					tw.Write("\"a23\":");
					tw.Write(a23==null?"null" : a23.ToString());
					tw.Write(",");
					tw.Write("\"a24\":");
					tw.Write(a24==null?"null" : a24.ToString());
					tw.Write(",");
					tw.Write("\"a25\":");
					tw.Write(a25==null?"null":((bool)a25?"true":"false"));
					tw.Write(",");
					tw.Write("\"a26\":");
					tw.Write("\"");
					tw.Write(a26==null?"null":a26.ToString());
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"a27\":");
					tw.Write("\"");
					tw.Write(a27==null?"null":a27.ToString());
					tw.Write("\"");

			tw.Write("}");
		}
		#endregion
    }
}
